import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = new int[n];
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>((o1, o2)->{
            return o2- o1;
        });
        long sum = 0;
        for(int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            if(a[i] % 2 == 0) {
                priorityQueue.offer(a[i]);
            }else {
                sum += a[i];
            }
        }
        for(int i = 0; i < k && !priorityQueue.isEmpty(); i++) {
            int tmp = priorityQueue.poll() / 2;
            if(tmp % 2 == 0) {
                priorityQueue.offer(tmp);
            }else {
                sum += tmp;
            }
        }
        while(!priorityQueue.isEmpty()) {
            sum += priorityQueue.poll();
        }
        System.out.println(sum);
    }
}

class IntCmp implements Comparator<Integer> {
    public int compare(Integer o1, Integer o2) {
        return o2.compareTo(o1);
    }
}